package com.dic.common.base.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

@MappedSuperclass
@Data
public class BaseEntity implements Comparable<Object> {

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID", nullable = false,length = 32)
	private String id;

	//创建时间
	@CreatedDate
	@Column(name = "CREATE_TIME")
	private Date createTime;

	//更新时间
	@Column(name = "UPDATE_TIME")
	@LastModifiedDate
	private Date updateTime;

	@Override
	public int compareTo(Object o) {
		return 1;
	}

	
	
}
